#include <iostream>
#include <fstream>
#include <string>
using namespace std;

int main()
{
    ifstream ifs("data\\input.txt");
    if (!ifs.is_open())
    {
        cout << "can not open input file!" << endl;
        return -1;
    }

    ofstream ofs("result\\output.txt");
    if (!ofs.is_open())
    {
        cout << "can not open output file!" << endl;
        return -1;
    }

    string s;
    while (true)
    {
        getline(ifs, s);
        if (ifs.eof())
        {
            break;
        }
        cout << s << endl;
        ofs << s << endl;
    }

    return 0;
}
